import 'package:kkhousekeep/generated/json/base/json_convert_content.dart';
import 'package:kkhousekeep/models/home_notice_entity.dart';

HomeNoticeEntity $HomeNoticeEntityFromJson(Map<String, dynamic> json) {
	final HomeNoticeEntity homeNoticeEntity = HomeNoticeEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		homeNoticeEntity.code = code;
	}
	final HomeNoticeObj? obj = jsonConvert.convert<HomeNoticeObj>(json['obj']);
	if (obj != null) {
		homeNoticeEntity.obj = obj;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		homeNoticeEntity.msg = msg;
	}
	return homeNoticeEntity;
}

Map<String, dynamic> $HomeNoticeEntityToJson(HomeNoticeEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['obj'] = entity.obj.toJson();
	data['msg'] = entity.msg;
	return data;
}

HomeNoticeObj $HomeNoticeObjFromJson(Map<String, dynamic> json) {
	final HomeNoticeObj homeNoticeObj = HomeNoticeObj();
	final List<HomeNoticeObjList>? list = jsonConvert.convertListNotNull<HomeNoticeObjList>(json['list']);
	if (list != null) {
		homeNoticeObj.list = list;
	}
	final int? total = jsonConvert.convert<int>(json['total']);
	if (total != null) {
		homeNoticeObj.total = total;
	}
	return homeNoticeObj;
}

Map<String, dynamic> $HomeNoticeObjToJson(HomeNoticeObj entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['list'] =  entity.list.map((v) => v.toJson()).toList();
	data['total'] = entity.total;
	return data;
}

HomeNoticeObjList $HomeNoticeObjListFromJson(Map<String, dynamic> json) {
	final HomeNoticeObjList homeNoticeObjList = HomeNoticeObjList();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		homeNoticeObjList.id = id;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		homeNoticeObjList.title = title;
	}
	final String? publisher = jsonConvert.convert<String>(json['publisher']);
	if (publisher != null) {
		homeNoticeObjList.publisher = publisher;
	}
	final String? context = jsonConvert.convert<String>(json['context']);
	if (context != null) {
		homeNoticeObjList.context = context;
	}
	final int? views = jsonConvert.convert<int>(json['views']);
	if (views != null) {
		homeNoticeObjList.views = views;
	}
	final String? publishTime = jsonConvert.convert<String>(json['publishTime']);
	if (publishTime != null) {
		homeNoticeObjList.publishTime = publishTime;
	}
	final String? createTime = jsonConvert.convert<String>(json['createTime']);
	if (createTime != null) {
		homeNoticeObjList.createTime = createTime;
	}
	final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
	if (updateTime != null) {
		homeNoticeObjList.updateTime = updateTime;
	}
	final int? cid = jsonConvert.convert<int>(json['cid']);
	if (cid != null) {
		homeNoticeObjList.cid = cid;
	}
	final int? read = jsonConvert.convert<int>(json['read']);
	if (read != null) {
		homeNoticeObjList.read = read;
	}
	return homeNoticeObjList;
}

Map<String, dynamic> $HomeNoticeObjListToJson(HomeNoticeObjList entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['title'] = entity.title;
	data['publisher'] = entity.publisher;
	data['context'] = entity.context;
	data['views'] = entity.views;
	data['publishTime'] = entity.publishTime;
	data['createTime'] = entity.createTime;
	data['updateTime'] = entity.updateTime;
	data['cid'] = entity.cid;
	data['read'] = entity.read;
	return data;
}